$(function(){ 
	init();
}); 
function init(){
	$("#addBtn").click(function(){
		var usersequence = $("#usersequence").val();
		var editor = $(".w-e-text").html();
		if(editor == ""){
			alert("请输入想要发送的内容！");
			return;
		}
		if(usersequence==""){
			alert("请登录后重试！");
			window.location.href="login";
		}else{
			 $.ajax({
		    	 type : "post",
		         url : "/TeaCulture/chatTea/do",
		         data : { "usersequence" : usersequence , "content" : editor },
		         dataType : "json",
		         traditional : true,
		         success : function(data){
		        	 if(data.result.code == 1){
		        		 alert("发送成功");
		        		 location.reload();
		        	 }else{
		        		 alert(data.result.des);
		        	 }
		        	
		            	
		        },    
		        error : function(data){
		            alert(data.result.des);
		        }
		    });
		}
	});
}